package com.sk.cardeal.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sk.cardeal.R;
import com.sk.cardeal.entity.ApplyBean;

import java.util.List;

/**
 * Created by sk on 2018/1/22.
 */

public class ApplyAdapter extends BaseQuickAdapter<ApplyBean, BaseViewHolder> {

    public ApplyAdapter(int layoutResId, @Nullable List<ApplyBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ApplyBean item) {
        helper.setText(R.id.tv_name, item.getName())
                .setText(R.id.tv_vin, "VIN:" + item.getVin())
                .setText(R.id.edit_num, String.valueOf(item.getCount()))
                .addOnClickListener(R.id.add)
                .addOnClickListener(R.id.reduce);
    }
}
